#pragma once
#include "note.h"
#include "snake.h"
#include "food.h"
#include "trap.h"
#include "cocos2d.h"
#include "supersnake.h"
using namespace cocos2d;
#define MAP_SIZE 22
#define MAP_SIZE_WIDTH 20
#define MAP_SIZE_HEIGHT 12

class supersnake;
class snake;
class food;
class trap;
class world : public CCLayer
{
private:
	world *self;
	snake *sk;
	food *fd;
	trap *td;
	supersnake *supersk;
	int score;
public:
	note *map[MAP_SIZE_WIDTH][MAP_SIZE_HEIGHT];
	world(void);
	world* getself();
	void putsnake(int x,int y,world* w);
	void putsupersnake(int x,int y,world* w);
	void putfood(world *w);
	void puttrap(world *w);
	bool run(world *w);
	void setdirection(char d);
	bool super_run(world *w);
	char getdirection();
	void gameover();
	int getscore();
	int getsnakelength();
	int getsupersnakelength();
	bool changeSpeed();
	void resetchangeSpeed();
	bool changesuperSpeed();
	void resetchangesuperSpeed();
	note getsnakehead();
	note* getfood();

	~world(void);
};